package com.wtwd.campus.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.campus.entity.SysOrg;
import com.wtwd.campus.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wtwd.campus.entity.SysRolePermission;
import com.wtwd.campus.model.vo.SysOrgVO;
import com.wtwd.campus.model.vo.SysRoleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zdl
 * @since 2021-06-17
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {


    void saveRolePermissionBatch(@Param("sysRolePermissions") List<SysRolePermission> sysRolePermissions);

    int deleteRolePermissionByRoleId(Integer roleId);

    List<Integer> getRolePermissionIdsByRoleId(Integer roleId);

    IPage<SysRoleVO> querylist(@Param("page") Page<SysRoleVO> page, @Param("sysRole") SysRole sysRole);

    int deleteRolePermissionByRoleIdsAndPermissionIds(@Param("roleIds") List<Integer> roleIds,@Param("permissionIds") List<Integer> permissionIds);

}
